package com.model.model02.demo02.factory;

import com.model.model02.demo02.discount.CashNormal;
import com.model.model02.demo02.discount.CashRebate;
import com.model.model02.demo02.discount.CashReturn;
import com.model.model02.demo02.discount.abs.CashSuper;

public class CashFactory {

    public static CashSuper createCashAccept(int discount) {
        CashSuper cs = null;
        switch (discount) {
            case 0: cs = new CashNormal(); break;
            case 1: cs = new CashReturn(300, 100); break;
            case 2: cs = new CashRebate(0.8); break;
            default:
                System.out.println("暂无对应折扣");
        }
        return cs;
    }
}
